// 用于主页面通用内容
import Main from '@/views/main.vue';
// 用于二级页面的内容
import SubMain from '@/views/sub-main.vue';

export default {
	path: '/goods',
	name: 'goods',
	redirect: '/goods/goods/list',
	meta: {
		title: '商品',
		icon: 'md-shirt'
	},
    component: Main,
    children: [
    	{
    		path: 'goods',
			name: 'goods_goods',
			component: SubMain,
			children: [{
					path: 'list',
					name: 'goods_goods_list',
					meta: {
						title: '商品信息'
					},
					component: resolve => {
						require(['@/views/goods/goods/index.vue'], resolve)
					}
				},
				{
					path: 'edit',
					name: 'goods_goods_edit',
					meta: {
						title: '商品编辑',
						active: 'goods_goods_list'
					},
					component: resolve => {
						require(['@/views/goods/goods/edit.vue'], resolve)
					}
				},
				{
					path: 'classify',
					name: 'goods_goods_classify_index',
					meta: {
						title: '分类信息'
					},
					component: resolve => {
						require(['@/views/goods/classify/index.vue'], resolve)
					}
				},
				{
					path: 'classifyEdit',
					name: 'goods_goods_classify_edit',
					meta: {
						title: '分类编辑',
						active: 'goods_goods_classify_index'
					},
					component: resolve => {
						require(['@/views/goods/classify/edit.vue'], resolve)
					}
				},
				{
					path: 'brand',
					name: 'goods_goods_brand_index',
					meta: {
						title: '品牌信息'
					},
					component: resolve => {
						require(['@/views/goods/brand/index.vue'], resolve)
					}
				},
				{
					path: 'brandEdit',
					name: 'goods_goods_brand_edit',
					meta: {
						title: '品牌编辑',
						active: 'goods_goods_brand_index'
					},
					component: resolve => {
						require(['@/views/goods/brand/edit.vue'], resolve)
					}
				},
				{
					path: 'specs',
					name: 'goods_goods_specs_index',
					meta: {
						title: '规格管理'
					},
					component: resolve => {
						require(['@/views/goods/specs/index.vue'], resolve)
					}
				},
				{
					path: 'specsEdit',
					name: 'goods_goods_specs_edit',
					meta: {
						title: '规格编辑',
						active: 'goods_goods_specs_index'
					},
					component: resolve => {
						require(['@/views/goods/specs/edit.vue'], resolve)
					}
				},
				{
					path: 'types',
					name: 'goods_goods_types_index',
					meta: {
						title: '类型管理'
					},
					component: resolve => {
						require(['@/views/goods/types/index.vue'], resolve)
					}
				},
				{
					path: 'typesEdit',
					name: 'goods_goods_types_edit',
					meta: {
						title: '类型编辑',
						active: 'goods_goods_types_index'
					},
					component: resolve => {
						require(['@/views/goods/types/edit.vue'], resolve)
					}
				},
				{
					path: 'group',
					name: 'goods_goods_group_index',
					meta: {
						title: '商品分组'
					},
					component: resolve => {
						require(['@/views/goods/group/index.vue'], resolve)
					}
				}
				,
				{
					path: 'groupEdit',
					name: 'goods_goods_group_edit',
					meta: {
						title: '分组编辑',
						active: 'goods_goods_group_index'
					},
					component: resolve => {
						require(['@/views/goods/group/edit.vue'], resolve)
					}
				}
			]
		},
		{
			path: 'library',
			name: 'goods_library',
			component: SubMain,
			meta: {
				divider: true
			},
			children: [
				{
					path: 'distribution',
					name: 'goods_library_distribution',
					meta: {
						title: '分销市场',
						cache: true
					},
					component: resolve => {
						require(['@/views/goods/distribution/index.vue'], resolve)
					}
				},
				{
					path: 'resources',
					name: 'goods_library_resources',
					meta: {
						title: '系统图库',
						cache: true
					},
					component: resolve => {
						require(['@/views/goods/resources/index.vue'], resolve)
					}
				}
			]
		}
    ]
}
